<template>
  <div>
    <h1>子组件接到父组件传参</h1>
    <br>
    {{newList}}
  </div>
</template>

<script>
export default {
  name: 'passNab',
  props: {
    newList: {
      typeof: Array,
      default: () => []
    }
  },
  created () {
    this.init()
  },
  methods: {
    init () {
      const res = this.newList.map(item => {
        return item.name
      })
      this.$emit('getNewList', res)
    }
  }

}
</script>

<style lang="scss" scoped>

</style>
